<!--#
layout("/layouts/platform.html"){
#-->
<header class="header navbar bg-white shadow">
    <div class="btn-group tool-button">
        <a class="btn btn-primary navbar-btn" href="${base}/platform/dec/component?versionType=${versionType!}" id="goBack" data-pjax><i class="ti-angle-left"></i>${msg['globals.button.back']}</a>
    </div>
</header>

<div class="content-wrap">
    <div class="wrapper" style="min-height:500px;">
        <section class="panel panel-form">
            <form id="addForm" role="form" class="form-horizontal parsley-form" data-parsley-validate
                  action="${base}/platform/dec/component/addDo" method="post">
                <div class="row mb10 mt10">
                    <div class="col-lg-12">
                        <div class="form-group">
                            <label for="compId" class="col-sm-2 control-label">${msg['dec.component.column.compId']}</label>
                            <div class="col-sm-8">
                                <input type="text" id="compId" class="form-control" name="compId" data-parsley-required="true" placeholder="${msg['dec.component.column.compId']}">
                            </div>
                        </div>
                      <div class="form-group">
                            <label for="compCategoryUuid" class="col-sm-2 control-label">${msg['dec.component.column.compCategoryUuid']}</label>
                            <div class="col-sm-8">
                                <select id="compCategoryUuid" class="form-control" name="compCategoryUuid">
                                    <!--# for(o in list){
        #-->
                                    <option value="${o.id}">${o.categoryName}</option>
                                    <!--#
                    }#-->
                                 </select>
                                  </div>
                              </div>
                              <div class="form-group">
                                  <label for="compName" class="col-sm-2 control-label">${msg['dec.component.column.compName']}</label>
                                  <div class="col-sm-8">
                                  <input type="text" id="compName" class="form-control" name="compName" data-parsley-required="true" placeholder="${msg['dec.component.column.compName']}">
                                  </div>
                              </div>
                              <!--<div class="form-group">
                                  <label for="compImage" class="col-sm-2 control-label">${msg['dec.component.column.compImage']}</label>
                                  <div class="col-sm-8">
                                  <input type="text" id="compImage" class="form-control" name="compImage" data-parsley-required="true" placeholder="${msg['dec.component.column.compImage']}">
                                  </div>
                              </div>-->
                                <div class="form-group">
                                    <label for="versionType" class="col-sm-2 control-label">${msg['dec.component.column.versionType']}</label>
                                    <div class="col-sm-8">
                                        <select id="versionType" class="form-control" name="versionType" data-parsley-required="true">
                                            <option value="">-请选择-</option>
                                            <option value="1" <!--#if(versionType=="1"){#-->selected<!--#}#-->>电脑端</option>
                                            <option value="2" <!--#if(versionType=="2"){#-->selected<!--#}#-->>手机端</option>
                                            <option value="3">微信端</option>
                                            <option value="4">电视端</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="competence" class="col-sm-2 control-label">${msg['dec.component.column.competence']}</label>
                                    <div class="col-sm-8">
                                        <select id="competence" class="form-control" name="competence" data-parsley-required="true">
                                            <option value="">-请选择-</option>
                                            <option value="1">公共类</option>
                                            <option value="2">平台类</option>
                                            <option value="3">商户类</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="compType" class="col-sm-2 control-label">${msg['dec.component.column.compType']}</label>
                                    <div class="col-sm-8">
                                        <select id="compType" class="form-control" name="compType" data-parsley-required="true">
                                            <option value="">-请选择-</option>
                                            <option value="1">系统组件</option>
                                            <option value="2">自定义组件</option>
                                        </select>
                                    </div>
                                </div>
                              <div class="form-group">
                                  <label for="classFullName" class="col-sm-2 control-label">${msg['dec.component.column.classFullName']}</label>
                                  <div class="col-sm-8">
                                      <input type="text" id="classFullName" class="form-control" name="classFullName" data-parsley-required="true" placeholder="${msg['dec.component.column.classFullName']}">
                                      <span class="star-red">请填写有效的类路径，如：com.aebiz.app.dec.commons.comps.bottom.vo.BottomCompModel</span>
                                  </div>
                              </div>
                              <div class="form-group">
                                  <label for="description" class="col-sm-2 control-label">${msg['dec.component.column.description']}</label>
                                  <div class="col-sm-8">
                                  <input type="text" id="description" class="form-control" name="description" data-parsley-required="true" placeholder="${msg['dec.component.column.description']}">
                                  </div>
                              </div>
                              <div class="form-group">
                                  <label for="disabled" class="col-sm-2 control-label">${msg['dec.component.column.disabled']}</label>
                                  <div class="col-sm-8 switcha">
                                      <div class="mr15">
                                          <input type="checkbox" id="disabled" name="disabled"
                                                 value="1" class="js-switch-blue">
                                      </div>
                                  </div>
                              </div>
                          </div>
                      </div>
                      <div class="col-lg-3"></div>
                      <div class="col-lg-6">
                          <div class="form-group text-center">
                              <label></label>

                              <div>
                                  <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="${msg['globals.button.submit.tip']}">${msg['globals.button.submit']}</button>
                              </div>
                          </div>
                      </div>
                  </form>
              </section>
          </div>
      </div>
      <script language="JavaScript">
          $(document).ready(function () {
              myForm.init();
              $('#addForm').ajaxForm({
                  dataType: 'json',
                  beforeSubmit: function (arr, form, options) {
                      form.find("button:submit").button("loading");
                  },
                  success: function (data, statusText, xhr, form) {
                      if (data.code == 0) {
                          Toast.success(data.msg);
                          form.resetForm();
                      } else {
                          Toast.error(data.msg);
                      }
                      form.find("button:submit").button("reset");
                  }
              });
          });
      </script>
      <!--#}#-->


